home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib43 / mntlib / pause.c < prev    next >
C/C++ Source or Header  |  1993-07-06  |  659b  |  43 lines

  1. /* public domain pause(), by ers */
  2.  
  3. #include <mintbind.h>
  4. #include <signal.h>
  5. #include <errno.h>
  6. #include <unistd.h>
  7.  
  8. extern int __mint;
  9.  
  10. int
  11. pause()
  12. {
  13.     if (__mint)
  14.         (void)Pause();
  15.     /* do nothing for TOS */
  16.     errno = EINTR;
  17.     return -1;
  18. }
  19.  
  20. /* Public domain sigpause() - AGK */
  21.  
  22. void
  23. sigpause(mask)
  24.     long mask;
  25. {
  26.     long oldmask;
  27.  
  28.     if (__mint == 0) {
  29.     /* for TOS, we just toggle the signal mask -- maybe
  30.      * there's a pending signal that we can receive.
  31.          */
  32.         oldmask = sigsetmask(mask);
  33.         sigsetmask(oldmask);
  34.     }
  35.     else if (__mint <= 94) {
  36.         oldmask = Psigsetmask(mask);
  37.         (void)Pause();
  38.         (void)Psigsetmask(oldmask);
  39.     }
  40.     else
  41.         (void)Psigpause(mask);
  42. }
  43.